package sistemioperativi.barbiere.es12;

public class Cliente implements Runnable {

	private Salone salone;
	
	public Cliente(Salone salone){
		this.salone = salone;
	}
	
	public void run(){
		try{
			
			raggiungiSalone();
			
			if(salone.entra()){
				System.out.println("Servito");
			}else{
				System.out.println("NON servito");
			}
			
		}catch(InterruptedException e){
			// NO OP
		}
	}
	
	private void raggiungiSalone() throws InterruptedException{
		Barbiere.attendi(2, 12);
	}

}
